import { reactive, effect, computed } from '../packages/reactivity/src/index';

const obj = reactive({
  name: '张三',
});

const computedObj = computed(() => {
  console.log('计算属性执行计算');
  return '姓名：' + obj.name;
});

effect(() => {
  document.querySelector('#app')!.innerHTML = computedObj.value;
});

setTimeout(() => {
  obj.name = '李四';
}, 2000);

